package com.banmao.youZone.util;

public class Base64Utils {

    private static final int CACHE_SIZE = 1024;

    public static byte[] decode(String str) throws Exception {
        return Base64.decode(str);
    }

    public static String encode(byte[] bArr) throws Exception {
        return new String(Base64.encode(bArr));
    }

    public static String encodeStr(String str) throws Exception {
        return encode(str.getBytes("utf-8"));
    }

    public static String decodeToStr(String str) throws Exception {
        return new String(Base64.decode(str), "utf-8");
    }

}
